//
//  ViewController.m
//  LD_Networking
//
//  Created by Da.Lee on 2017/11/13.
//  Copyright © 2017年 lida. All rights reserved.
//

#import "ViewController.h"
#import "YQNetworking.h"
#import "Decription.h"

//===========================宏定义输出===========================
#ifdef DEBUG
#define LOG(xx, ...)  NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#elif RELEASE
#define LOG(xx, ...)  ((void)0)
#else
#define LOG(xx, ...)  ((void)0)
#endif

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}
- (IBAction)postTest:(UIButton *)sender {
    
    NSString *url = @"http://192.168.18.249/user/register";
    NSDictionary *param = @{
                            @"member_name":@"lida",
                            @"member_mobile":@"15510178810",
                            @"member_email":@"15510178810@163.com",
                            @"member_passwd":@"lida12345678",
                            @"remember_passwd":@"lida12345678",
                            @"member_type":@0,
                            @"step":@1
                            };
    
    [YQNetworking postWithUrl:url refreshRequest:YES cache:NO params:param progressBlock:^(int64_t bytesRead, int64_t totalBytes) {
        
    } successBlock:^(id response) {
        LOG(@"success---%@",response);
    } failBlock:^(NSError *error) {
        LOG(@"failed---%@",error);
    }];
}

- (IBAction)getTest:(UIButton *)sender {
    NSString *url = @"http://192.168.18.249/user/verify_name";
    
    NSDictionary *param = @{
                            @"member_name":@"lida",
                            };
    
    [YQNetworking getWithUrl:url refreshRequest:YES cache:NO params:param progressBlock:^(int64_t bytesRead, int64_t totalBytes) {
        
    } successBlock:^(id response) {
        LOG(@"success---%@",response);
    } failBlock:^(NSError *error) {
        LOG(@"failed---%@",error);
    }];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
